﻿@{
    ViewBag.Title = "Chat";
    Layout = null;
}
<script type="text/javascript" src="/Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/Scripts/jquery.signalR-1.1.3.js"></script>
<script src="/SignalR/Hubs"></script>
<script type="text/javascript">
    $(document).ready(function () {

        var chat = $.connection.chatHub;

        chat.client.writeMessage = function (msg) {
            $("#messages").append("<li>" + msg + "</li>");
        }

        $("#btnTamam").click(function () {
            chat.server.broadcastMessage($("#txtInput").val());
        });

        $.connection.hub.start();
    });

</script>
<h2>Interaktif Chat Sayfası</h2>

<div id="messages"></div>
<input type="text"  id="txtInput"/>
<input type="button" id="btnTamam" value="Tamam" />
